package com.lmpop.updateHtml.parseHtml;

import com.lmpop.frame.dao.JdbcDbm;
import com.lmpop.trade.ti_createlog.Ti_createlogInfo;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

public class InfoVo
{
  private JdbcDbm jdbcDbm;

  public InfoVo()
  {
    this.jdbcDbm = new JdbcDbm();
  }

  public List getInfoList(String sql, Map<String,String> map) {
    int start = 0; 
    int row = 0;
    if ((map != null) && (map.get("start") != null) && (!map.get("start").toString().equals(""))) {
      start = Integer.parseInt(map.get("start").toString());
    }
    if ((map != null) && (map.get("row") != null) && (!map.get("row").toString().equals(""))) {
      row = Integer.parseInt(map.get("row").toString());
    }
    if (row != 0) {
      sql = sql + " limit " + start + "," + row;
    }
    List qlist = this.jdbcDbm.queryList(sql);

    return qlist;
  }

  public List getInfoListArti(String sql, Map map) {
    int start = 0; int row = 0;
    if ((map != null) && (map.get("start") != null) && (!map.get("start").toString().equals(""))) {
      start = Integer.parseInt(map.get("start").toString());
    }
    if ((map != null) && (map.get("row") != null) && (!map.get("row").toString().equals(""))) {
      row = Integer.parseInt(map.get("row").toString());
    }
    if (row != 0) {
      sql = sql + " limit " + start + "," + row;
    }
    List qlist = this.jdbcDbm.queryList(sql);
    List qresult = new ArrayList();
    String str1 = ""; String str2 = "";
    Ti_createlogInfo createlog = new Ti_createlogInfo();
    List loglist = createlog.getListByAll();
    if ((qlist != null) && (qlist.size() > 0))
    {
      for (int i = 0; i < qlist.size(); i++)
      {
        Map tmepmap1 = (Hashtable)qlist.get(i);
        if ((tmepmap1.get("info_id") != null) && (!tmepmap1.get("info_id").toString().equals(""))) str1 = tmepmap1.get("info_id").toString();
        if ((loglist == null) || (loglist.size() <= 0))
          continue;
        for (int j = 0; j < loglist.size(); j++)
        {
          Map tmepmap2 = (Hashtable)loglist.get(j);
          if ((tmepmap2.get("info_id") != null) && (!tmepmap2.get("info_id").toString().equals(""))) str2 = tmepmap2.get("info_id").toString();
          if (!str1.equals(str2))
            continue;
          qresult.add(tmepmap1);
        }

      }

    }

    return qresult;
  }
}